import Vue from 'vue'
import weex from 'weex-vue-render'
/* global Vue */

weex.init(Vue)
/* weex initialized here, please do not move this line */
const { router } = require('./router')
const App = require('@/index.vue')
import mixins from '@/mixins'
import store from '@/store';

Vue.prototype.$store = store;
Vue.mixin(mixins)

function render(props) {

    new Vue(Vue.util.extend({ el: '#weex', router }, App))
    router.push('/')
}

if (!window.__POWERED_BY_QIANKUN__) {
    render({});
}

export async function bootstrap() {
    console.log('[react16] react app bootstraped');
}

export async function mount(props) {
    console.log('[react16] props from main framework', props);
    render(props);
}

export async function unmount(props) {
    new Vue(Vue.util.extend({ el: '#weex', router }, App))
}